﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EzDesk.Core.Model;
using EzDesk.Core.CoreImpl;

using System.Xml.Linq;
using EzDesk.Utility.EzML;

namespace EzDesk.Core.ServiceWebRef
{

    public class CoreClientWebRef : ICoreClientService
    {
        public ICoreClientService _clientService;

        public CoreClientWebRef()
        {
            _clientService = new CoreClientService();
        }

        #region IEzDeskCore Members
        public string OutputStr(string str)
        {
            return _clientService.OutputStr(str);
        }

        public IList<App> GetCurrentApps()
        {
            return _clientService.GetCurrentApps();
        }

        #endregion


        public void SetFeedIsRead(Guid feedId, string memberString, bool isRead)
        {
            _clientService.SetFeedIsRead(feedId, memberString, isRead);
        }

        public string Login(string uid, string pwd)
        {
            return _clientService.Login(uid, pwd);
        }


        public void ChangeUserDept(Guid userId, Guid deptId)
        {
            _clientService.ChangeUserDept(userId, deptId);
        }

        public void ChangeUserReportId(Guid userId, Guid reportId)
        {
            _clientService.ChangeUserReportId(userId, reportId);
        }

        public void ChangeUserPosition(Guid userId, Guid positionId)
        {
            _clientService.ChangeUserPosition(userId, positionId);
        }

        public UserProfile CreateEmptyUserProfile(string userName)
        {
            return _clientService.CreateEmptyUserProfile(userName);
        }

        public UserProfile GetUserProfileById(Guid userId)
        {
            return _clientService.GetUserProfileById(userId);
        }

        public SimpleUser GetSimpleUserById(Guid userId)
        {
            return _clientService.GetSimpleUserById(userId);
        }

        public IList<SimpleUser> GetSimpleUserInfos(string memberstring)
        {
            return _clientService.GetSimpleUserInfos(memberstring);
        }

        public string GetXmlFeedsBetweenDate(string feedTypeStr, Guid userId, DateTime from, DateTime to, bool? isRead, bool? isAvaiable)
        {
            return _clientService.GetXmlFeedsBetweenDate(feedTypeStr, userId, from, to, isRead, isAvaiable);
        }

        public string GetXmlFeedsByCount(string feedTypeStr, Guid userId, int startIndex, int count, bool? isRead, bool? isAvaiable)
        {
            return _clientService.GetXmlFeedsByCount(feedTypeStr, userId, startIndex, count, isRead, isAvaiable);
        }

        public void SetFeedsIsRead(string feedIdStrs, string memberString, bool isRead)
        {
            _clientService.SetFeedsIsRead(feedIdStrs, memberString, isRead);
        }


        public App GetAppByName(string appName)
        {
            return _clientService.GetAppByName(appName);
        }

        public IList<AppTask> GetAllAppTasks(Guid userId, string userAgent)
        {
            return _clientService.GetAllAppTasks(userId, userAgent);
        }

        public IList<AppTask> GetAppTasksByAppName(string appName, Guid userId, string userAgent)
        {
            return _clientService.GetAppTasksByAppName(appName, userId, userAgent);
        }


        public UserProfile GetUserProfileByUserName(string userName)
        {
            return _clientService.GetUserProfileByUserName(userName);
        }
    }
}
